package com.wn.provider.controller;

import com.wn.bean.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Random;
import java.util.UUID;

/**
 * @author yellow Docter
 * @date 2023 -08-07
 * @desc
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @GetMapping("get/{id}")
    public User getUserById(@PathVariable("id") Integer id){

        User user = new User();
        user.setName(UUID.randomUUID().toString().substring(0,5) + id);
        user.setAge(new Random().nextInt(30));
        user.setDesc("hello");
        return user;
    }

}
